#!/bin/bash
function checkprocess(){
    if (ps aux|grep -v grep|grep "$1" )
    then
        echo "active"
    else
        echo "miss"
        #echo $1
        php $1 &
    fi
}

cd /opt/www/jiafuyun_api/
checkprocess "/opt/www/jiafuyun_api/script/crontab.php"
checkprocess "/opt/www/jiafuyun_api/script/exec_close_unpay_order_task.php"